cmake_minimum_required(VERSION 3.14)

project(openvino-cpu-win-msvc2019 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# find openvino
# windows sample
# set(OpenVINO_DIR "C:/Program Files (x86)/Intel/openvino_2024/runtime/cmake")
# set(OpenCV_DIR "C:/Program Files/opencv460/build/x64/vc15/lib")

# linux sample
set(OpenVINO_DIR "/home/tacom/Development/Mounts/Envs/openvino_2024/runtime/cmake/")
set(OpenCV_DIR "/home/tacom/Development/Mounts/Envs/opencv_490_gpu/lib/cmake/opencv4/")

find_package(OpenCV)
find_package(OpenVINO REQUIRED COMPONENTS Runtime)

# find qt core
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)

add_executable(openvino-cpu-win-msvc2019
  main.cpp
  Network/DebugTools.h Network/DebugTools.cpp
  Network/NetworkTools.h Network/NetworkTools.cpp
  Network/DenseGradeWrapper.h Network/DenseGradeWrapper.cpp
)

target_include_directories(openvino-cpu-win-msvc2019
    PRIVATE
        ${OpenCV_INCLUDE_DIRS}
        .
)

target_link_libraries(openvino-cpu-win-msvc2019
    Qt${QT_VERSION_MAJOR}::Core
    openvino::runtime
    ${OpenCV_LIBS}
)

include(GNUInstallDirs)
install(TARGETS openvino-cpu-win-msvc2019
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
